<template>
    <div demo-bg>
        <dv-scroll-board :config="computedConfig" style="width:400px;height:600px; margin-left: 10px" />
    </div>
</template>
<script setup>
import { reactive, computed } from 'vue'
const props = defineProps(["datalist"])
const computedConfig = computed(() => {
    const { datalist } = props
    const data = datalist.sort((item1, item2) => Date.parse(item2.employ_date) - Date.parse(item1.employ_date))
    const configObj = {}
    data.forEach(item => {
        configObj[item.studentname] = item.company
    })
    return {
        header: ['学生姓名', '入职公司'],
        data: Object.entries(configObj),
        index: true,
        columnWidth: [50],
        align: ['center'],
        headerBGC: 'rgba(0,0,0,0)',
        indexHeader: '*'
    }
})
const config = reactive()

</script>
<style scoped lang='scss'></style>